#!/bin/bash

# make

CC = gcc -g
AR = ar


LDLIBS = -lm -L ../complib/libsim/ -lsim -L ../complib/libtsninsight -ltsninsight -L ../complib/libtsmp -ltsmp  

LDLIBS1 = -I ../complib/cjson/ -L ../complib/cjson -lcjson
TSMPAPI = ../complib/libtsmp/
PTPSRC = ./src/


OSS: main.c  $(PTPSRC)ptp_tsninsight.c $(PTPSRC)8021AS_PTP.c $(PTPSRC)hardware_report.c $(PTPSRC)software_read.c
	
ifeq (READ,$(OSS_TYPE))
	$(CC) -D $(OSS_TYPE) -o OSS main.c $(PTPSRC)ptp_tsninsight.c $(PTPSRC)8021AS_PTP.c $(PTPSRC)software_read.c $(LDLIBS1) $(TSMPAPI)libtsmp.a $(LDLIBS) 
	$(warning "the value is $(OSS_TYPE)")
else ifeq (REPORT,$(OSS_TYPE))
	$(CC) -D $(OSS_TYPE) -o OSS main.c $(PTPSRC)ptp_tsninsight.c $(PTPSRC)8021AS_PTP.c $(PTPSRC)hardware_report.c $(LDLIBS1) $(TSMPAPI)libtsmp.a $(LDLIBS) 
	$(warning "the value is $(OSS_TYPE)")
endif

clean:
	rm -rf OSS $(PTPSRC)*.o
